package com.xhs.controller;

import com.xhs.dto.request.IdParams;
import com.xhs.message.ReturnResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import java.util.List;

/**
 * @desc: 参数校验案例二
 * @projectName: spring-boot-demo
 * @author: xhs
 * @date: 2025-06-07 周六 23:44
 */
@Validated
@RestController
public class CheckParamV2Controller {

    /**
     * 批量删除企业
     *
     * @param list 入参
     * @return ReturnResult<Object>
     */
    @PostMapping("/delete/v2")
    public ReturnResult<String> delete(@RequestBody @Valid @NotEmpty(message = "list不能为空") List<IdParams> list) {
        return ReturnResult.success("删除成功");
    }
}
